package com.lagou.sqlSession;

import com.lagou.cofig.XmlConfigBuilder;

import lagou.io.pojo.Configuration;

import java.io.InputStream;

/**
 * 工厂构建类
 */

public class SqlSessionFactoryBuilder {

    public  static SqlSessionFactory build(InputStream input) throws Exception {
        XmlConfigBuilder xmlConfigBuilder = new XmlConfigBuilder();
        Configuration configuration=xmlConfigBuilder.parseConfigura(input);

        //创建SqlSessionFactory
        SqlSessionFactory sqlSesionFactory = new DefaultSqlSessionFactory(configuration);
        return  sqlSesionFactory;
    }
}
